package servlet.account.page;

import jakarta.servlet.ServletException;
import jakarta.servlet.annotation.WebServlet;
import jakarta.servlet.http.HttpServlet;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;
import servlet.account.control.InfoCheck;

import java.io.IOException;



@WebServlet(urlPatterns = {"/Home","/home","/Index","/index","/Welcome","/welcome"})
public class Home extends HttpServlet {
    @Override
    protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        InfoCheck infoCheck = new InfoCheck();
        if (infoCheck.checkCredentials(req)) {
            req.setAttribute("Login","Session");
        }
        req.getRequestDispatcher("chushi/jsp/home.jsp").forward(req, resp);
    }

    @Override
    protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        this.doGet(req, resp);
    }
}
